package com.chen.controller;


import com.chen.common.Result;
import com.chen.entity.Details;
import com.chen.service.DetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Y·C
 * @since 2023-04-20
 */
@Api(tags = "详细信息接口")
@RestController
@RequestMapping("/details")
public class DetailsController {

    @Autowired
    private DetailsService detailsService;

    @ApiOperation("填写详细信息接口 id、creat_time、uid不用填写")
    @PostMapping("/insertDetails")
    public Result detailsInfo(@RequestBody Details details){
        detailsService.detailInfo(details);
        return Result.success();
    }

    @ApiOperation("修改详细信息接口 id、creat_time不用填写 uid传当前用户id")
    @PostMapping("/updateDetails")
    public Result updateDetailsInfo(@RequestBody Details details){
        detailsService.updateDetailsInfo(details);
        return Result.success();
    }

}

